import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import query from '@dfeidao/atom-nodejs/db/query';
import { productid,systemid } from '../../atom/config';

interface Message {
	filter:{
		project_no:string
	}
}


export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders){
	const p = query(action_id,session_id,systemid);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['work_bill_no'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['work_bill_no']);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['job_content'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['job_content']);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['create_time'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['create_time']);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['cust_name'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['cust_name']);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['project_name'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['project_name']);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['work_order_status'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['work_order_status']);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, ['source_type'], []);
	p.prepare('work_order', ['work_bill_no','job_content','create_time','project_no','cust_name','project_name','work_order_status','source_type'], { productid },20, 1, [], ['source_type']);
	const [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14] = await p.exec();
	return{d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14};
}
